home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v10n16.arc
/
DIRANY.BAT
< prev
next >
Wrap
DOS Batch File
|
1991-08-27
|
741b
|
31 lines
@ECHO OFF
IF '%1'=='' GOTO syntax
SET N=
CALL GETLEN %1
SET temp=%1*.*
IF %N%==8 GOTO doit
SET temp=%temp% ?%1*.*
IF %N%==7 GOTO doit
SET temp=%temp% ??%1*.*
IF %N%==6 GOTO doit
SET temp=%temp% ???%1*.*
IF %N%==5 GOTO doit
SET temp=%temp% ????%1*.*
IF %N%==4 GOTO doit
SET temp=%temp% ?????%1*.* *.%1*
IF %N%==3 GOTO doit
SET temp=%temp% ??????%1*.* *.?%1*
IF %N%==2 GOTO doit
SET temp=%temp% ???????%1.* *.??%1
:doit
FOR %%f IN (%temp%) DO ECHO %%f
SET temp=
SET N=
GOTO end
:syntax
ECHO DIRANY lists files whose names _contain_ a certain string.
ECHO Syntax: "DIRANY string n"
ECHO where "string" is a string of 1 to 8 characters (no wildcards)
ECHO and "n" is the length of that string.
:end